package com.undsf.chaldea.util

/**
 * Created by Arathi on 2017-08-23.
 */
class Converter private constructor() {
    private object Holder {
        val INSTANCE = Converter()
    }

    companion object {
        val instance: Converter by lazy {
            Holder.INSTANCE
        }
    }

    fun percentToDouble(percent: String): Double {
        if (percent.endsWith("%")) {
            val digital = percent.substring(0, percent.length-1)
            val value: Double = digital.toDouble()
            return value/100.0
        }
        return 0.0
    }
}
